'use strict'

const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}


module.exports = {
  lintOnSave: false,
  // 配置跨域代理
  devServer: {
    // Paths
    host: '0.0.0.0',
    port: process.env.port || process.env.npm_config_port || 80,
    https: false,
    open: true,
    proxy: {
      '/dev-api': {
        target: 'http://localhost:9096/manage-api/v1', // 代理目标的基础路径
        changeOrigin: true, // 支持跨域
        pathRewrite: {
          '^\\/dev-api': ''
        }
      }
    }
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('src')
      }
    }
  }
}
